package com.storyroad.utils;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 *	Opens up a connection to access the DB 
 *
 */
public class DBConnection {

	private String username = "project6";
	private String password = "bZZcj8pJ";
	String url = "jdbc:mysql://titan.cmpe.boun.edu.tr:3306/database6?useUnicode=true&amp;characterEncoding=utf8";
	Connection conn = null;

	/**
	 * Creates a connection to the DB
	 * @return a Connection object to access the DB
	 */
	public Connection connect() {
		String driver = "com.mysql.jdbc.Driver";
		try {
			Class.forName(driver);
			conn = DriverManager.getConnection(url, username, password);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return conn;
	}
}
